import request from '@/utils/request'
export default {
  //添加
  add (data) {
    return request({
      url: '/firmwareService/user/addUser',
      method: 'POST',
      data
    })
  },
  //修改
  edit (data) {
    return request({
      url: '/firmwareService/user/edit',
      method: 'POST',
      data
    })
  },
  //修改密码
  editPassword (data) {
    return request({
      url: '/firmwareService/user/editPassword',
      method: 'POST',
      data
    })
  },
  //审核用户列表
  queryAuditList () {
    return request({
      url: '/firmwareService/user/queryAuditList',
      method: 'get'
    })
  },
  //审核
  examine (data) {
    return request({
      url: '/firmwareService/user/examine',
      method: 'post',
      data
    })
  },
  //列表查询
  queryList (params) {
    return request({
      url: '/firmwareService/user/queryList',
      method: 'get',
      params
    })
  },
  //分页查询
  queryPageList (params) {
    return request({
      url: '/firmwareService/user/queryPageList',
      method: 'get',
      params
    })
  },
  //树形结构查询
  queryTree () {
    return request({
      url: '/firmwareService/user/queryTree',
      method: 'get'
    })
  },
  //主键删除接口
  del (id) {
    return request({
      url: '/firmwareService/user/del',
      method: 'post',
      data: {
        userId: id
      }
    })
  },
  //主键批量删除接口
  delList (idList) {
    return request({
      url: '/firmwareService/user/delList',
      method: 'post',
      data: {
        userIdList: idList
      }
    })
  },
  //停用/启用
  editUserStatus (data) {
    return request({
      url: '/firmwareService/user/editUserStatus',
      method: 'post',
      data
    })
  },
  //用户绑定设备
  userBandDeviceList (data) {
    return request({
      url: '/firmwareService/device/userBandDeviceList',
      method: 'post',
      data
    })
  },
  //获取用户可用设备
  getListByUserName(params) {
    return request({
      url: '/firmwareService/device/getListByUserName',
      method: 'get',
      params
    })
  },
  //分配功能
  addFilesToUser (data) {
    return request({
      url: '/firmwareService/user/addFilesToUser',
      method: 'post',
      data
    })
  },
  // 通过用户Id查询用户本身的功能权限列表
  queryUserFuncList(userId) {
    return request({
      url: `/firmwareService/user/queryUserFuncList?userId=${userId}`,
      method: 'get'
    })
  },
  //分配功能
  addFuncList (data) {
    return request({
      url: '/firmwareService/user/addFuncList',
      method: 'post',
      data
    })
  },
}